package com.hundredhealth.rose;

import android.app.Application;
import android.content.Context;

import com.hundredhealth.rose.crash.CustomActivityOnCrash;
import com.kymjs.rxvolley.toolbox.Loger;
import com.lvrenyang.io.BTPrinting;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by huazhong on 26/5/2017.
 */

public class HealthLabelApp extends Application {
    public final static int PRINT_WIDTH = ((int) (48.0D / 25.4D * 203.0D * 1.0D));
    public final static int PRINT_HEIGHT = ((int) (20.0D / 25.4D * 203.0D * 1.0D));
    public static boolean bluetooth_ready = false;
    public static ExecutorService executorService;
    private static HealthLabelApp _instance;
    public static BTPrinting mBTPrinting;

    static {
        executorService = Executors.newScheduledThreadPool(30);
        mBTPrinting = new BTPrinting();
    }

    public static HealthLabelApp getInstance() {
        return _instance;
    }

    public static Context getContext() {
        return _instance.getApplicationContext();
    }

    @Override
    public void onCreate() {
        super.onCreate();
        _instance = this;
        Loger.setEnable(BuildConfig.DEBUG);
        CustomActivityOnCrash.install(this);
    }
}
